﻿<%@ WebHandler Language="C#" Class="SIPO.Web.AjaxHandler.Transaction.recDevolutionhandler" %>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

using SIPO.Library.DataAccess.Transaction;
using SIPO.Library.DomainObject.Transaction;
using SIPO.Library.DataAccess.Administration;
using SIPO.Library.DomainObject.Administration;
using SIPO.Library.DomainObject.Administration.UserManagement;
using SIPO.Library.DataAccess.Administration.UserManagement;

using System.Net.Mail;
using System.Net;
using System.Web.SessionState;

using SIPO.Library.Enum;
using SIPO.Web.Support;

using Newtonsoft.Json.Linq;

namespace SIPO.Web.AjaxHandler.Transaction
{
    public class recDevolutionhandler : SIPO.Web.BaseHandler
    {
        private recDevolutionRepo recDevolutionDal = new recDevolutionRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);
        private recDevolutionProcessDetailRepo recDevolutionProcessDetDal = new recDevolutionProcessDetailRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);
        
        private recLogRepo logDal = new recLogRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);
        recDemand recDemand = new recDemand();
        private string MethodName = string.Empty;
        
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);

            MethodName = context.Request.Params["method"];

            context.Response.Clear();
            context.Response.Buffer = true;

            switch (MethodName.ToLower())
            {
                case ("insert"):
                    context.Response.Write(Insert(context));
                    break;
                case ("insertdevalutionprocess"):
                    context.Response.Write(InsertDevalutionProcess(context));
                    break;
                case ("update"):
                    context.Response.Write(Update(context));
                    break;
                case ("updatedevalutionprocess"):
                    context.Response.Write(UpdateDevalutionProcess(context));
                    break;
                case ("getdata"):
                    context.Response.Write(GetData(context));
                    break;
                case ("getdatadevolutionprocess"):
                    context.Response.Write(GetDataDevolutionProcess(context));
                    break;
                case ("getdatamonitoringdevolutionprocess"):
                    context.Response.Write(GetDataMonitoringDevolutionProcess(context));
                    break;
                case ("getdatamonitoringdevolutionprocessdetail"):
                    context.Response.Write(GetDataMonitoringDevolutionProcessDetail(context));
                    break;
                default:
                    // do nothing
                    break;
            }
        }

        public string Insert(HttpContext context)
        {
            JSONHelper helper = new JSONHelper();
            recDevolutionRepo recDevolutionDal = new recDevolutionRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);

            try
            {
                var data = context.Request.Form;
                var devolutionId = data["hfId"] == null ? 0 : int.Parse(data["hfId"].ToString());
                var demandNo = data["hfDemandNo"] == null ? 0 : int.Parse(data["hfDemandNo"].ToString());
                var debtorName = data["hfDebtorName"] == null ? string.Empty : context.Server.UrlDecode(data["hfDebtorName"]);
                var debtorId = data["txtDebtorId"] == null ? string.Empty : context.Server.UrlDecode(data["txtDebtorId"].ToString());
                var letterNo = data["txtLetterNo"] == null ? string.Empty : context.Server.UrlDecode(data["txtLetterNo"].ToString());
                var letterDate = data["txtLetterDate"] == null ? string.Empty : context.Server.UrlDecode(data["txtLetterDate"].ToString());
                var devolutionDate = data["txtDevolutionDate"] == null ? string.Empty : context.Server.UrlDecode(data["txtDevolutionDate"].ToString());
                var devolutionValues = data["txtDevolutionValues"] == null ? string.Empty : context.Server.UrlDecode(data["txtDevolutionValues"].ToString());
                var note = data["txtCatatan"] == null ? string.Empty : context.Server.UrlDecode(data["txtCatatan"]);
    

                recDevolution obj = new recDevolution();
                obj.DevolutionID = devolutionId;
                obj.DemandNo = demandNo;
                obj.DebtorName = debtorName;
                obj.DebtorID = int.Parse(debtorId);
                obj.LetterNo = letterNo;
                obj.LetterDate = letterDate == null ? (DateTime?)null : Helper.FormatDate(letterDate, Helper.Culture.Indonesian);
                obj.DevolutionDate = devolutionDate == null ? (DateTime?)null : Helper.FormatDate(devolutionDate, Helper.Culture.Indonesian);
                obj.DevolutionValues = decimal.Parse(devolutionValues);
                obj.Balance = decimal.Parse(devolutionValues);
                obj.Note = note;
                obj.IsProcess = false;
                obj.IsActive = false;

                //jika ada file untuk diupaload
                if (context.Request.Files.Count > 0)
                {
                    HttpPostedFile hpf = context.Request.Files[0] as HttpPostedFile;
                    string fileName = data["name"]; // --> name taken from PLUPLOAD!

                    byte[] datas = new byte[hpf.ContentLength];
                    hpf.InputStream.Position = 0;
                    hpf.InputStream.Read(datas, 0, hpf.ContentLength);

                    obj.AttachFileName = fileName;
                    obj.AttachFile = datas;
                    hpf.InputStream.Close();
                    hpf.InputStream.Dispose();
                }

                obj.CreatedDate = DateTime.Now;
                obj.CreatedBy = base.UserLoggedIn;

                //lakukan insert recDevolution
                recDevolutionDal.Insert(obj);

                helper.IsSuccess = true;
                helper.Message = "berhasil di simpan !";
            }
            catch (Exception ex)
            {
                helper.IsSuccess = false;
                helper.Message = ex.Message;
            }
            finally
            {
                recLog log = new recLog();
                log.LogEvent = "Insert";
                log.LogMessage = helper.Message;
                log.LogSource = "recDemandhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);

            }

            return Newtonsoft.Json.JsonConvert.SerializeObject(helper);
        }

        public string InsertDevalutionProcess(HttpContext context)
        {
            JSONHelper helper = new JSONHelper();
            recDevolutionRepo recDevolutionDal = new recDevolutionRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);

            try
            {
                var data = context.Request.Form;
                var devolutionProcessID = data["hfDevolutionProcessId"] == null ? string.Empty : context.Server.UrlDecode(data["hfDevolutionProcessId"]);
                var devolutionID = data["ddlPengurusan"] == null ? string.Empty : context.Server.UrlDecode(data["ddlPengurusan"].ToString());
                var noSuratPengurusan = data["txtNoSuratPengurusan"] == null ? string.Empty : context.Server.UrlDecode(data["txtNoSuratPengurusan"].ToString());
                var tglSuratPengurusan = data["txtTglSuratPengurusan"] == null ? string.Empty : context.Server.UrlDecode(data["txtTglSuratPengurusan"].ToString());

                recDevolutionProcess obj = new recDevolutionProcess(true);
                obj.DevolutionProcessID = int.Parse(devolutionProcessID);
                obj.recDevolutionAction.DevolutionID = int.Parse(devolutionID);
                obj.recDevolutionProcessDetail.LetterDevProcessDetailNo = noSuratPengurusan;
                obj.recDevolutionProcessDetail.LetterDevProcessDetailDate = tglSuratPengurusan == null ? (DateTime?)null : Helper.FormatDate(tglSuratPengurusan, Helper.Culture.Indonesian);
              

                //jika ada file untuk diupaload
                if (context.Request.Files.Count > 0)
                {
                    HttpPostedFile hpf = context.Request.Files[0] as HttpPostedFile;
                    string fileName = data["name"]; // --> name taken from PLUPLOAD!

                    byte[] datas = new byte[hpf.ContentLength];
                    hpf.InputStream.Position = 0;
                    hpf.InputStream.Read(datas, 0, hpf.ContentLength);

                    obj.recDevolutionProcessDetail.AttachFileName = fileName;
                    obj.recDevolutionProcessDetail.AttachFile = datas;
                    hpf.InputStream.Close();
                    hpf.InputStream.Dispose();
                }

                obj.recDevolutionProcessDetail.CreatedDate = DateTime.Now;
                obj.recDevolutionProcessDetail.CreatedBy = base.UserLoggedIn;

                //lakukan insert recDevolution
                recDevolutionDal.insertDevolutionProcessDetail(obj);
                

                helper.IsSuccess = true;
                helper.Message = "berhasil di simpan !";
            }
            catch (Exception ex)
            {
                helper.IsSuccess = false;
                helper.Message = ex.Message;
            }
            finally
            {
                recLog log = new recLog();
                log.LogEvent = "InsertDevolutionProcess";
                log.LogMessage = helper.Message;
                log.LogSource = "recDevolutionhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);

            }

            return Newtonsoft.Json.JsonConvert.SerializeObject(helper);
        }

        public string UpdateDevalutionProcess(HttpContext context)
        {
            JSONHelper helper = new JSONHelper();
            recDevolutionRepo recDevolutionDal = new recDevolutionRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);
            string devolutionID = null;
            
            try
            {
                var data = context.Request.Form;
                var devolutionProcessDetailID = data["hfDevolutionProcessDetailId"] == null ? string.Empty : context.Server.UrlDecode(data["hfDevolutionProcessDetailId"]);
                var devolutionProcessID = data["hfDevolutionProcessId"] == null ? string.Empty : context.Server.UrlDecode(data["hfDevolutionProcessId"]);
                devolutionID = data["ddlPengurusan"] == null ? string.Empty : context.Server.UrlDecode(data["ddlPengurusan"].ToString());
                
                if (devolutionID.Equals(string.Empty))
                {
                    devolutionID = data["hfDevolutionId"] == null ? string.Empty : context.Server.UrlDecode(data["hfDevolutionId"].ToString());
                }
                
                var noSuratPengurusan = data["txtNoSuratPengurusan"] == null ? string.Empty : context.Server.UrlDecode(data["txtNoSuratPengurusan"].ToString());
                var tglSuratPengurusan = data["txtTglSuratPengurusan"] == null ? string.Empty : context.Server.UrlDecode(data["txtTglSuratPengurusan"].ToString());

                recDevolutionProcess obj = new recDevolutionProcess(true);
                obj.recDevolutionProcessDetail.DevolutionProcessDetailID = int.Parse(devolutionProcessDetailID);
                obj.DevolutionProcessID = int.Parse(devolutionProcessID);
                obj.recDevolutionAction.DevolutionID = int.Parse(devolutionID);
                obj.recDevolutionProcessDetail.LetterDevProcessDetailNo = noSuratPengurusan;
                obj.recDevolutionProcessDetail.LetterDevProcessDetailDate = tglSuratPengurusan == null ? (DateTime?)null : Helper.FormatDate(tglSuratPengurusan, Helper.Culture.Indonesian);


                //jika ada file untuk diupaload
                if (context.Request.Files.Count > 0)
                {
                    HttpPostedFile hpf = context.Request.Files[0] as HttpPostedFile;
                    string fileName = data["name"]; // --> name taken from PLUPLOAD!

                    byte[] datas = new byte[hpf.ContentLength];
                    hpf.InputStream.Position = 0;
                    hpf.InputStream.Read(datas, 0, hpf.ContentLength);

                    obj.recDevolutionProcessDetail.AttachFileName = fileName;
                    obj.recDevolutionProcessDetail.AttachFile = datas;
                    hpf.InputStream.Close();
                    hpf.InputStream.Dispose();
                }

                obj.recDevolutionProcessDetail.UpdatedDate = DateTime.Now;
                obj.recDevolutionProcessDetail.UpdatedBy = base.UserLoggedIn;

                //lakukan insert recDevolution
                recDevolutionDal.updateDevolutionProcessDetail(obj);

                helper.IsSuccess = true;
                helper.Message = "berhasil di ubah !";
            }
            catch (Exception ex)
            {
                helper.IsSuccess = false;
                helper.Message = ex.Message;
            }
            finally
            {
                recLog log = new recLog();
                log.LogEvent = "UpdateDevolutionProcess";
                log.LogMessage = helper.Message;
                log.LogSource = "recDevolutionhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);

            }

            return Newtonsoft.Json.JsonConvert.SerializeObject(helper);
        }
        
        public string Update(HttpContext context)
        {
            JSONHelper helper = new JSONHelper();
            recDevolutionRepo recDevolutionDal = new recDevolutionRepo(ConfigurationManager.ConnectionStrings["SIPOConn"].ConnectionString);

            try
            {
                var data = context.Request.Form;
                var devolutionId = data["hfId"] == null ? string.Empty : data["hfId"].ToString();
                var demandNo = data["hfDemandNo"] == null ? 0 : int.Parse(data["hfDemandNo"].ToString());
                var debtorName = data["hfDebtorName"] == null ? string.Empty : context.Server.UrlDecode(data["hfDebtorName"]);
                var debtorId = data["txtDebtorId"] == null ? string.Empty : context.Server.UrlDecode(data["txtDebtorId"].ToString());
                var letterNo = data["txtLetterNo"] == null ? string.Empty : context.Server.UrlDecode(data["txtLetterNo"].ToString());
                var letterDate = data["txtLetterDate"] == null ? string.Empty : context.Server.UrlDecode(data["txtLetterDate"].ToString());
                var devolutionDate = data["txtDevolutionDate"] == null ? string.Empty : context.Server.UrlDecode(data["txtDevolutionDate"].ToString());
                var devolutionValues = data["txtDevolutionValues"] == null ? string.Empty : context.Server.UrlDecode(data["txtDevolutionValues"].ToString());
                var note = data["txtCatatan"] == null ? string.Empty : context.Server.UrlDecode(data["txtCatatan"]);


                recDevolution obj = new recDevolution();
                obj.DevolutionID = int.Parse(devolutionId);
                obj.DemandNo = demandNo;
                obj.DebtorName = debtorName;
                obj.DebtorID = int.Parse(debtorId);
                obj.LetterNo = letterNo;
                obj.LetterDate = letterDate == null ? (DateTime?)null : Helper.FormatDate(letterDate, Helper.Culture.Indonesian);
                obj.DevolutionDate = devolutionDate == null ? (DateTime?)null : Helper.FormatDate(devolutionDate, Helper.Culture.Indonesian);
                obj.DevolutionValues = decimal.Parse(devolutionValues);
                obj.Balance = decimal.Parse(devolutionValues);
                obj.Note = note;
                obj.IsProcess = false;
                obj.IsActive = false;

                //jika ada file untuk diupaload
                if (context.Request.Files.Count > 0)
                {
                    HttpPostedFile hpf = context.Request.Files[0] as HttpPostedFile;
                    string fileName = data["name"]; // --> name taken from PLUPLOAD!

                    byte[] datas = new byte[hpf.ContentLength];
                    hpf.InputStream.Position = 0;
                    hpf.InputStream.Read(datas, 0, hpf.ContentLength);

                    obj.AttachFileName = fileName;
                    obj.AttachFile = datas;
                    hpf.InputStream.Close();
                    hpf.InputStream.Dispose();
                }

                obj.UpdatedDate = DateTime.Now;
                obj.UpdatedBy = base.UserLoggedIn;

                //lakukan insert recDevolution
                recDevolutionDal.Update(obj);

                helper.IsSuccess = true;
                helper.Message = "berhasil di ubah !";
            }
            catch (Exception ex)
            {
                helper.IsSuccess = false;
                helper.Message = ex.Message;
            }
            finally
            {
                recLog log = new recLog();
                log.LogEvent = "Update";
                log.LogMessage = helper.Message;
                log.LogSource = "recDevolutionhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);

            }

            return Newtonsoft.Json.JsonConvert.SerializeObject(helper);
        }

        public string GetData(HttpContext context)
        {
            string parameters = Helper.JqGridFilterToSQLParams(context);

            int page = 1;
            int.TryParse(context.Request.QueryString["page"] ?? "1", out page);

            int pageSize = 10;
            int.TryParse(context.Request.QueryString["rows"] ?? "10", out pageSize);

            string sidx = ((context.Request.QueryString["sidx"]) == null ? recDevolution.Fields.DebtorID : context.Request.QueryString["sidx"].ToString());

            string sord = ((context.Request.QueryString["sord"]) == null ? "ASC" : context.Request.QueryString["sord"].ToString());

            int totalCount = 0;
            int totalPages = 0;
            List<recDevolution> pagedList = null;

            try
            {
                //tampilkan data recDemand
                totalCount = Convert.ToInt32(recDevolutionDal.SelectScalar(SQL.Function.Aggregate.Count, "DevolutionID", parameters));

                decimal dc = decimal.Ceiling(Convert.ToDecimal(totalCount) / Convert.ToDecimal(pageSize));
                totalPages = Convert.ToInt32(dc);

                pagedList = recDevolutionDal.GetList(pageSize, page, sidx, sord, parameters);
            }
            catch (Exception ex)
            {
                recLog log = new recLog();
                log.LogEvent = "GetData";
                log.LogMessage = ex.Message;
                log.LogSource = "recDevolutionhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);
                log.Dispose();
            }
            finally
            {

            }
            // send params into jqGrid's format
            var gridData = new
            {
                page = page,
                total = totalPages,
                records = totalCount,
                rows = pagedList,

            };

            return Newtonsoft.Json.JsonConvert.SerializeObject(gridData);
        }

        public string GetDataDevolutionProcess(HttpContext context)
        {
            //insert data recDevolutionProcess
            recDevolutionDal.insertRecDevolutionProcess(base.UserLoggedIn);
            
            //tampilkan data recDevolutionProcess
            string parameters = Helper.JqGridFilterToSQLParams(context);

            if (parameters.Equals(string.Empty))
            {
                parameters += " WHERE recDevolutionProcessDetail.DevolutionProcessDetailID = (select id from dbo.fn_maxListDevolutionProcessDetailId())";
            }
            else
            {
                parameters += " AND recDevolutionProcessDetail.DevolutionProcessDetailID = (select id from dbo.fn_maxListDevolutionProcessDetailId())";
            }

            int page = 1;
            int.TryParse(context.Request.QueryString["page"] ?? "1", out page);

            int pageSize = 10;
            int.TryParse(context.Request.QueryString["rows"] ?? "10", out pageSize);

            string sidx = ((context.Request.QueryString["sidx"]) == null ? recDevolutionProcess.Fields.DebtorID : context.Request.QueryString["sidx"].ToString());

            string sord = ((context.Request.QueryString["sord"]) == null ? "ASC" : context.Request.QueryString["sord"].ToString());

            int totalCount = 0;
            int totalPages = 0;
            List<recDevolutionProcess> pagedList = null;

            try
            {
                //tampilkan data recDevolutionProcess
                totalCount = Convert.ToInt32(recDevolutionDal.SelectScalarDevolutionProcess(SQL.Function.Aggregate.Count, "recDevolutionProcess.DevolutionID", parameters));

                decimal dc = decimal.Ceiling(Convert.ToDecimal(totalCount) / Convert.ToDecimal(pageSize));
                totalPages = Convert.ToInt32(dc);

                pagedList = recDevolutionDal.GetListDevolutionProcess(pageSize, page, sidx, sord, parameters);
            }
            catch (Exception ex)
            {
                recLog log = new recLog();
                log.LogEvent = "GetDataDevolutionProcess";
                log.LogMessage = ex.Message;
                log.LogSource = "recDevolutionhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);
                log.Dispose();
            }
            finally
            {

            }
            // send params into jqGrid's format
            var gridData = new
            {
                page = page,
                total = totalPages,
                records = totalCount,
                rows = pagedList,

            };

            return Newtonsoft.Json.JsonConvert.SerializeObject(gridData);
        }

        public string GetDataMonitoringDevolutionProcess(HttpContext context)
        {
            //tampilkan data recDevolutionProcess
            string parameters = Helper.JqGridFilterToSQLParams(context);

            int debtorId = context.Request["DebtorID"].Equals(string.Empty) ? 0 : int.Parse(context.Request["DebtorID"].ToString());

            if (debtorId != 0)
            {
                if (parameters.Equals(string.Empty))
                {
                    parameters += " AND recDebtor.DebtorID = " + debtorId;
                }

            }
            
            int page = 1;
            int.TryParse(context.Request.QueryString["page"] ?? "1", out page);

            int pageSize = 10;
            int.TryParse(context.Request.QueryString["rows"] ?? "10", out pageSize);

            string sidx = ((context.Request.QueryString["sidx"]) == null ? recDevolutionProcess.Fields.DebtorName : context.Request.QueryString["sidx"].ToString());

            string sord = ((context.Request.QueryString["sord"]) == null ? "ASC" : context.Request.QueryString["sord"].ToString());

            int totalCount = 0;
            int totalPages = 0;
            List<recDevolutionProcess> pagedList = null;

            try
            {
                //tampilkan data recDevolutionProcess
                totalCount = Convert.ToInt32(recDevolutionDal.SelectScalarMonitoringDevolutionProcess(SQL.Function.Aggregate.Count, "recDevolutionProcess.DevolutionProcessID", parameters));

                decimal dc = decimal.Ceiling(Convert.ToDecimal(totalCount) / Convert.ToDecimal(pageSize));
                totalPages = Convert.ToInt32(dc);

                pagedList = recDevolutionDal.GetListMonitoringDevolutionProcess(pageSize, page, sidx, sord, parameters);
            }
            catch (Exception ex)
            {
                recLog log = new recLog();
                log.LogEvent = "GetDataMonitoringDevolutionProcess";
                log.LogMessage = ex.Message;
                log.LogSource = "recDevolutionhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);
                log.Dispose();
            }
            finally
            {

            }
            // send params into jqGrid's format
            var gridData = new
            {
                page = page,
                total = totalPages,
                records = totalCount,
                rows = pagedList,

            };

            return Newtonsoft.Json.JsonConvert.SerializeObject(gridData);
        }

        public string GetDataMonitoringDevolutionProcessDetail(HttpContext context)
        {
            //tampilkan data recDevolutionProcess
            string parameters = Helper.JqGridFilterToSQLParams(context);

            int page = 1;
            int.TryParse(context.Request.QueryString["page"] ?? "1", out page);

            int pageSize = 10;
            int.TryParse(context.Request.QueryString["rows"] ?? "10", out pageSize);

            string sidx = ((context.Request.QueryString["sidx"]) == null ? recDevolutionProcessDetail.Fields.LetterDevProcessDetailNo : context.Request.QueryString["sidx"].ToString());

            string sord = ((context.Request.QueryString["sord"]) == null ? "ASC" : context.Request.QueryString["sord"].ToString());

            int totalCount = 0;
            int totalPages = 0;
            List<recDevolutionProcessDetail> pagedList = null;

            try
            {
                //tampilkan data recDevolutionProcess
                totalCount = Convert.ToInt32(recDevolutionProcessDetDal.SelectScalar(SQL.Function.Aggregate.Count, "recDevolutionProcessDetail.DevolutionProcessDetailID"));

                decimal dc = decimal.Ceiling(Convert.ToDecimal(totalCount) / Convert.ToDecimal(pageSize));
                totalPages = Convert.ToInt32(dc);

                pagedList = recDevolutionProcessDetDal.GetList(pageSize, page, sidx, sord);
            }
            catch (Exception ex)
            {
                recLog log = new recLog();
                log.LogEvent = "GetDataMonitoringDevolutionProcessDetail";
                log.LogMessage = ex.Message;
                log.LogSource = "recDevolutionhandler.ashx";
                log.CreatedBy = base.UserLoggedIn;
                log.CreatedDate = DateTime.Now;
                logDal.Save(log);
                log.Dispose();
            }
            finally
            {

            }
            // send params into jqGrid's format
            var gridData = new
            {
                page = page,
                total = totalPages,
                records = totalCount,
                rows = pagedList,

            };

            return Newtonsoft.Json.JsonConvert.SerializeObject(gridData);
        }

        public override bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}